package jfuzzyprincepless.negotiation.impl;

import jfuzzyprincepless.negotiation.INegotiationContext;
import jfuzzyprincepless.negotiation.services.IService;

/**
 * unmodifiable decorator
 */
public class UnmodifiableNegotiationContext
	implements INegotiationContext
{
	private final INegotiationContext subContext;

	public UnmodifiableNegotiationContext(
		INegotiationContext subContext
	) {
		this.subContext = subContext;
	}
	
	@Override
	public <ServT extends IService> ServT getService(
			Class<ServT> clazz
	) {
		return subContext.getService(clazz);
	}

	@Override
	public void registerService(IService service) {
		throw new UnsupportedOperationException("is unmodifiable context");
	}
	
	@Override
	public <ServT extends IService> void registerService(
		Class<ServT> clazz,
		ServT service
	) {
		throw new UnsupportedOperationException("is unmodifiable context");
	}
}
